package com.zl.service;

import com.zl.dao.AccountDao;
import com.zl.model.Account;
import com.zl.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class AccountServiceIml implements AccountService {
    @Autowired
    private AccountDao accountDao;

    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }

    /**
     * 查询全部
     * @return
     */
    @Override
    public List<Account> findAll() {
        return accountDao.findAll();
    }

    /**
     * 添加
     * @param account
     * @return
     */
    @Override
    public int insert(Account account) {
        return accountDao.insert(account);
    }

    @Override
    public int delete(int id) {
        return accountDao.delete(id);
    }

    @Override
    public Account findOne(int id) {
        return accountDao.findOne(id);
    }

    @Override
    public int update(Account account) {
        return accountDao.update(account);
    }
}
